package com.ls.pattern.behavior.state;

//不能抽奖状态
public class NoRaffleState implements State {
    private RaffleActivity activity;

    public NoRaffleState(RaffleActivity activity) {
        this.activity = activity;
    }

    @Override
    public void deduceMoney() {
        if (activity.getCount() <= 0) {
            System.out.println("活动结束");
            return;
        }
        System.out.println("扣除50积分,开始抽奖");
        activity.setState(activity.getCanRaffleState());
    }

    @Override
    public boolean raffle() {
        System.out.println("扣了积分才能抽奖");
        return false;
    }

    @Override
    public void dispensePrize() {
        System.out.println("不能发放奖品");

    }
}
